﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using CHGK.web.UI.Models;


namespace ChGK.Data
{
    public class DataManager
    {
       private CHGKModelContainer _CHGKContainer;
    
        /*public DataManager()
        {
            _CHGKContainer = new CHGKModelContainer();
        }
        */

        public DataManager()
        {
            _CHGKContainer = new CHGKModelContainer();
        }
        
        private AnswerRepositry _AnswerRepositry;
        public AnswerRepositry Answers
        {
            get
            {
                if (_AnswerRepositry == null)
                    _AnswerRepositry = new AnswerRepositry(_CHGKContainer);

                return _AnswerRepositry;
            }
        }

        private CompetitionRepositry _CompetitionRepositry;
        public CompetitionRepositry Competitions
        {
            get
            {
                if (_CompetitionRepositry == null)
                    _CompetitionRepositry = new CompetitionRepositry(_CHGKContainer);

                return _CompetitionRepositry;
            }
        }

        private TeamRepositry _TeamRepositry;
        public TeamRepositry Teams
        {
            get
            {
                if (_TeamRepositry == null)
                    _TeamRepositry = new TeamRepositry(_CHGKContainer);

                return _TeamRepositry;
            }
        }

        private TourRepositry _TourRepositry;
        public TourRepositry Tours
        {
            get
            {
                if (_TourRepositry == null)
                    _TourRepositry = new TourRepositry(_CHGKContainer);

                return _TourRepositry;
            }
        }

        private UserRepositry _UserRepositry;
        public UserRepositry Users
        {
            get
            {
                if (_UserRepositry == null)
                    _UserRepositry = new UserRepositry(_CHGKContainer);

                return _UserRepositry;
            }
        }
     }
}
